package com.clj.fastble.exception;

import ohos.bluetooth.BluetoothHost;
import ohos.bluetooth.ble.BlePeripheralDevice;

/**
 * ConnectException
 */
public class ConnectException extends BleException {
    private BlePeripheralDevice bluetoothGatt;
    private int gattStatus;

    public ConnectException(BlePeripheralDevice bluetoothGatt, int gattStatus) {
        super(ERROR_CODE_GATT, "Gatt Exception Occurred! ");
        this.bluetoothGatt = bluetoothGatt;
        this.gattStatus = gattStatus;
    }

    public int getGattStatus() {
        return gattStatus;
    }

    public ConnectException setGattStatus(int gattStatus) {
        this.gattStatus = gattStatus;
        return this;
    }

    public BlePeripheralDevice getBluetoothGatt() {
        return bluetoothGatt;
    }

    public ConnectException setBluetoothGatt(BlePeripheralDevice bluetoothGatt) {
        this.bluetoothGatt = bluetoothGatt;
        return this;
    }

    @Override
    public String toString() {
        return "ConnectException{"
                + "gattStatus="
                + gattStatus
                + ", bluetoothGatt="
                + bluetoothGatt
                + "} "
                + super.toString();
    }
}
